package com.iot.ammeter.ui.components.auth

import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.Icon
import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.TextFieldDefaults
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Lock
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import com.iot.ammeter.R
import com.iot.ammeter.ui.theme.material3OutlinedTextFieldColors

@Composable
fun PasswordTextFiled(
    value: String,
    modifier: Modifier = Modifier,
    onValueChange: (String) -> Unit
) = OutlinedTextField(
    label = { Text(text = stringResource(id = R.string.password)) },
    leadingIcon = {
        Icon(
            imageVector = Icons.Filled.Lock,
            contentDescription = stringResource(id = R.string.password)
        )
    },
    value = value,
    onValueChange = onValueChange,
    maxLines = 1,
    singleLine = true,
    modifier = modifier.fillMaxWidth(),
    colors = TextFieldDefaults.material3OutlinedTextFieldColors()
)